package com.evaluationsystem.config.exceptionAdvice;

import lombok.extern.log4j.Log4j;
import org.springframework.boot.web.server.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;

@Log4j
@Configuration
public class ExceptionAdvice  {
    @Bean
    public WebServerFactoryCustomizer<ConfigurableWebServerFactory> webServerFactoryCustomizer() {
        return (factory -> {
            ErrorPage errorPage404 = new ErrorPage(HttpStatus.NOT_FOUND, "/erro/404");
            factory.addErrorPages(errorPage404);
        });
    }
}
